package com.sample.trace.utils;


import java.util.Map;

/**
 * ThreadLocal 存储 TraceId
 */
public class TraceLocalUtil {

    private static final ThreadLocal<Map<String, Object>> traceIdTreadLocal = new ThreadLocal<>();

    public static void setMap(Map<String, Object> traceMap) {
        traceIdTreadLocal.set(traceMap);
    }

    public static Map<String, Object> getMap() {
        return traceIdTreadLocal.get();
    }

    public static void clear() {
        traceIdTreadLocal.remove();
    }
}
